package org.bit.practice03;

public class Demo03 {
    public static void main(String[] args) throws InterruptedException {
        MyBlockingQueue queue = new MyBlockingQueue(3);
        queue.put(1);
        queue.put(2);
        queue.put(3);
        System.out.println("已经添加 3 个元素");
//        queue.put(4); // 打印不出来
//        System.out.println("已经添加 4 个元素");
        System.out.println(queue.take());
        System.out.println(queue.take());
        System.out.println(queue.take());
        System.out.println("已经取出 3 个元素");
        System.out.println(queue.take());
        System.out.println("已经取出 4 个元素");
    }
}
